@extends('{{ base_layout }}')

@section('{{ section_title|default('title') }}')
Show {{ model_class }} [{{ '{{ ' }} ${{ model_name }}->id {{ '}}' }}] ::
@parent
@stop

{% if section_breadcrumb is defined %}
    @section('{{ section_breadcrumb }}')
    <li><a href="{{ '{{ ' }} route('home') {{ '}}' }}"><i class="icon-home"></i> Dashboard</a><span class="divider"><i class="icon-angle-right"></i></span></li>
    <li><a href="{{ '{{ ' }} route('{{ route_prefix }}.{{ model_name }}.index') {{ '}}' }}"><i class="icon-home"></i> {{ model_class }} list</a><span class="divider"><i class="icon-angle-right"></i></span></li>
    <li class="active">Show {{ model_class }} [{{ '{{ ' }} ${{ model_name }}->id {{ '}}' }}] </li>
    @stop
{% endif %}

@section('{{ section_content|default('content') }}')

<p>{{ '{{ ' }}link_to_route('{{ route_prefix }}.{{ model_name }}.index', 'Back to {{ model_class}} list', null, array('class' => 'btn btn-info')) {{ '}}' }}</p>

<div class="row-fluid">
<table class="table table-bordered">

</table>

    <table class="table table-striped table-bordered">
        <col width="35%">
        <col width="60%">
        <tbody>
        {% for field, definition in fields %}
        <tr> <th>{{ field|title }}</th> <td>{{ '{{ ' }} ${{ model_name }}->{{ field }} {{ '}}' }}</td> </tr>
        {% endfor %}

        {% if relations.belongsTo is defined %}
            {% for relation_name, related in relations.belongsTo %}
                <tr>
                    <th>{{ related|replace('_', ' ')|title }}</th>
                    <td>{{ '{{ ' }} ${{ model_name }}->{{ relation_name }}()->first() ? link_to_route('{{ route_prefix }}.{{ related }}.show', ${{ model_name }}->{{ relation_name }}()->first()->name, array('id' => ${{ model_name }}->{{ relation_name }}()->first()->id), array()) : 'NULL' {{ '}}' }}</td>
                </tr>
            {% endfor %}
        {% endif %}

        <tr><td colspan="2">
                {% if softdelete %}
                    @if ( ! is_null(${{ model_name }}->deleted_at))
                    <a href="{{ '{{ ' }} route('{{ route_prefix }}.{{ model_name }}.restore', ${{ model_name }}->id) {{ '}}' }}" class="btn btn-mini btn-warning">Restore</a>
                    @else
                    <a href="{{ '{{ ' }} route('{{ route_prefix }}.{{ model_name }}.delete', ${{ model_name }}->id) {{ '}}' }}" class="btn btn-mini btn-danger">Delete</a>
                    @endif
                {% else %}
                    <a href="{{ '{{ ' }} route('{{ route_prefix }}.{{ model_name }}.delete', ${{ model_name }}->id) {{ '}}' }}" class="btn btn-mini btn-danger">Delete</a>
                {% endif %}
            </td></tr>
        </tbody>
    </table>
@stop